home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pango-1.0 / pango / pangofc-font.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  5.1 KB  |  149 lines

  1. /* Pango
  2.  * pangofc-font.h: Base fontmap type for fontconfig-based backends
  3.  *
  4.  * Copyright (C) 2003 Red Hat Software
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. #ifndef __PANGO_FC_FONT_H__
  23. #define __PANGO_FC_FONT_H__
  24.  
  25. #include <ft2build.h>
  26. #include FT_FREETYPE_H
  27. #include <fontconfig/fontconfig.h>
  28. #include <pango/pango-font.h>
  29. #include <pango/pango-fontmap.h>
  30. #include <pango/pango-glyph.h>
  31.  
  32. G_BEGIN_DECLS
  33.  
  34. #define PANGO_TYPE_FC_FONT              (pango_fc_font_get_type ())
  35. #define PANGO_FC_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_FONT, PangoFcFont))
  36. #define PANGO_IS_FC_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_FONT))
  37.  
  38. typedef struct _PangoFcFont      PangoFcFont;
  39. typedef struct _PangoFcFontClass PangoFcFontClass;
  40.  
  41. #if defined(PANGO_ENABLE_ENGINE) || defined(PANGO_ENABLE_BACKEND)
  42.  
  43. /**
  44.  * PANGO_RENDER_TYPE_FC:
  45.  * 
  46.  * A string constant used to identify shape engines that work
  47.  * with the fontconfig based backends. See the @engine_type field
  48.  * of #PangoEngineInfo.
  49.  **/
  50. #define PANGO_RENDER_TYPE_FC "PangoRenderFc"
  51.  
  52. #ifdef PANGO_ENABLE_BACKEND
  53.  
  54. #define PANGO_FC_FONT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FC_FONT, PangoFcFontClass))
  55. #define PANGO_IS_FC_FONT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_FONT))
  56. #define PANGO_FC_FONT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_FONT, PangoFcFontClass))
  57.  
  58. /**
  59.  * PangoFcFont:
  60.  * 
  61.  * #PangoFcFont is a base class for font implementations
  62.  * using the FontConfig and FreeType libraries and is used in
  63.  * conjunction with #PangoFcFontMap. When deriving from this
  64.  * class, you need to implement all of its virtual functions
  65.  * other than shutdown() along with the get_glyph_extents()
  66.  * virtual function from #PangoFont.
  67.  **/
  68. struct _PangoFcFont
  69. {
  70.   PangoFont parent_instance;
  71.  
  72.   FcPattern *font_pattern;        /* fully resolved pattern */
  73.   PangoFontMap *fontmap;        /* associated map */
  74.   gpointer context_key;            /* used internally */
  75.   PangoMatrix matrix;            /* used internally */
  76.   PangoFontDescription *description;
  77.   
  78.   GSList *metrics_by_lang;
  79.  
  80.   guint is_hinted : 1;
  81.   guint is_transformed : 1;
  82. };
  83.  
  84. /**
  85.  * PangoFcFontClass:
  86.  * @lock_face: Returns the FT_Face of the font and increases
  87.  *  the reference count for the face by one.
  88.  * @unlock_face: Decreases the reference count for the
  89.  *  FT_Face of the font by one. When the count is zero,
  90.  *  the #PangoFcFont subclass is allowed to free the
  91.  *  FT_Face.
  92.  * @has_char: Return %TRUE if the the font contains a glyph
  93.  *   corresponding to the specified character.
  94.  * @get_glyph: Gets the glyph that corresponds to the given
  95.  *   Unicode character.
  96.  * @get_unknown_glyph: Gets the glyph that should be used to
  97.  *   display an unknown-glyph indication for the specified
  98.  *   Unicode character.
  99.  * @shutdown: Performs any font-specific shutdown code that
  100.  *   needs to be done when pango_fc_font_map_shutdown is called.
  101.  *   May be %NULL.
  102.  *
  103.  * Class structure for #PangoFcFont.
  104.  **/
  105. struct _PangoFcFontClass
  106. {
  107.   /*< private >*/
  108.   PangoFontClass parent_class;
  109.  
  110.   /*< public >*/
  111.   FT_Face    (*lock_face)         (PangoFcFont      *font);
  112.   void       (*unlock_face)       (PangoFcFont      *font);
  113.   gboolean   (*has_char)          (PangoFcFont      *font,
  114.                    gunichar          wc);
  115.   guint      (*get_glyph)         (PangoFcFont      *font,
  116.                    gunichar          wc);
  117.   PangoGlyph (*get_unknown_glyph) (PangoFcFont      *font,
  118.                    gunichar          wc);
  119.   void       (*shutdown)          (PangoFcFont      *font);
  120.   /*< private >*/
  121.  
  122.   /* Padding for future expansion */
  123.   void (*_pango_reserved1) (void);
  124.   void (*_pango_reserved2) (void);
  125.   void (*_pango_reserved3) (void);
  126.   void (*_pango_reserved4) (void);
  127. };
  128.  
  129. #endif /* PANGO_ENABLE_BACKEND */
  130.  
  131. gboolean   pango_fc_font_has_char          (PangoFcFont      *font,
  132.                         gunichar          wc);
  133. guint      pango_fc_font_get_glyph         (PangoFcFont      *font,
  134.                         gunichar          wc);
  135. PangoGlyph pango_fc_font_get_unknown_glyph (PangoFcFont      *font,
  136.                         gunichar          wc);
  137. void       pango_fc_font_kern_glyphs       (PangoFcFont      *font,
  138.                         PangoGlyphString *glyphs);
  139.  
  140. #endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */
  141.  
  142. GType      pango_fc_font_get_type (void);
  143.  
  144. FT_Face    pango_fc_font_lock_face         (PangoFcFont      *font);
  145. void       pango_fc_font_unlock_face       (PangoFcFont      *font);
  146.  
  147. G_END_DECLS
  148. #endif /* __PANGO_FC_FONT_H__ */
  149.